﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace machine_registration.Models
{
    //public partial  class Information_Push: ObservableObject
    //{
    //    [ObservableProperty]
    //    private int _ID;
    //    /// <summary>
    //    /// 消息类型 1:提醒 2:加班提醒 3:错误
    //    /// </summary>
    //    [ObservableProperty]
    //    private string _Type;
    //    [ObservableProperty]
    //    private TimeSpan _time;
    //    [ObservableProperty]
    //    private string _message;
    //    [ObservableProperty]
    //    private bool _isok;
    //    /// <summary>
    //    /// 企业微信地址
    //    /// </summary>
    //    [ObservableProperty]
    //    private string _Enterprise_wechat_address;

    //}
    public partial class Information_Push : INotifyPropertyChanged
    {
        private int _id;
        private string _message;
        private bool _isok;
        private TimeSpan _time;
        private string _enterpriseWechatAddress;
        private string _Type;
        public int ID
        {
            get => _id;
            set { _id = value; OnPropertyChanged(); }
        }
        public string Type
        {
            get => _Type;
            set { _Type = value; OnPropertyChanged(); }
        }

        public string Message
        {
            get => _message;
            set { _message = value; OnPropertyChanged(); }
        }

        public bool Isok
        {
            get => _isok;
            set { _isok = value; OnPropertyChanged(); }
        }

        public TimeSpan Time
        {
            get => _time;
            set { _time = value; OnPropertyChanged(); }
        }

        public string Enterprise_wechat_address
        {
            get => _enterpriseWechatAddress;
            set { _enterpriseWechatAddress = value; OnPropertyChanged(); }
        }

        public event PropertyChangedEventHandler? PropertyChanged;

        protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
